<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
    <div id="app">
      <h2>{{person.name}}--{{person.age}}</h2>
      <h3>{{person.fav}}</h3>
      <h3>{{msg}}</h3>
      <div v-text="msg">
        <div></div>
      </div>
      <div v-text="person.name">
      </div>
      <div v-html="htmlStr">
      </div>
      <input type="text" v-model="person.fav">
      <button v-on:click="handleClick">click me</button>
      <button @click="handleClick2">click me2</button>
    </div>
    <script src="./Observer.js"></script>
    <script src="./Mvue.js"></script>
    <script>
      let vm = new Mvue({
        el:"#app",
        data:{
          person:{
            name:"小马",
            age:"18",
            fav:"姑娘"
          },
          msg:"学习mvvm实现原理",
          htmlStr:"<h2>aaa</h2>"
        },
        methods:{
          handleClick(){
            console.log(this.$data.person.fav);
          },
          handleClick2(){
            console.log('click2!');
          }
        }
      })
    </script>
</body>
</html>